<?php /* Smarty version 2.6.18, created on 2013-06-09 17:44:57
         compiled from modules/ordenes.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'modules/ordenes.tpl', 82, false),)), $this); ?>
<?php echo '
	<script src="jquery/js/jquery-1.8.3.js"></script>
	<script src="jquery/js/jquery-ui.js"></script>
	<script type="text/javascript" src="jquery/js/jquery.js"></script>
	
	
	
	<script type="text/javascript" src="jquery/js/jNotify.jquery.js"></script>
	<link rel="stylesheet" href="jquery/css/jNotify.jquery.css" type="text/css" />
'; ?>


<?php echo '
	<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
	<link rel="stylesheet" href="/resources/demos/style.css" />
	<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
	<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
      
	<script>
		$(function() {
			$( "#progressbar" ).progressbar({
				value: false
			});
			
			$( "button" ).on( "click", function( event ) {
				var target = $( event.target ),
					progressbar = $( "#progressbar" ),
					progressbarValue = progressbar.find( ".ui-progressbar-value" );
				
				if ( target.is( "#numButton" ) ) {
					progressbar.progressbar( "option", {
						value: Math.floor( Math.random() * 100 )
					});
				} else if ( target.is( "#colorButton" ) ) {
					progressbarValue.css({
						"background": \'#\' + Math.floor( Math.random() * 16777215 ).toString( 16 )
					});
				} else if ( target.is( "#falseButton" ) ) {
					progressbar.progressbar( "option", "value", false );
				}
			});
		});
	</script>
	
	<style>
		#progressbar .ui-progressbar-value {
			background-color: #ccc;
		}
	</style>
'; ?>




<div class="infoPedidos">
	<h2>
		<?php echo $this->_tpl_vars['lang']['reg_order_history_label']; ?>
 | <?php echo $this->_tpl_vars['infoUsuario']['0']['name']; ?>
, <?php echo $this->_tpl_vars['infoUsuario']['0']['last_name']; ?>

	</h2>
	
	<?php if ($this->_tpl_vars['error'] == 1): ?>
		<div class="errorLocalCerrado">
			<?php echo $this->_tpl_vars['lang']['reg_no_orders_message']; ?>

		</div>
	<?php else: ?>
		<div class="tablaInfoPedidos">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>     		
      			<td>
      				<b><?php echo $this->_tpl_vars['lang']['reg_date_label']; ?>
</b>
      			</td>
      		
      			<td>
      				<b>Estado del Pedido</b>
      			</td>
      		
      			<td>
      				<b>Acciones</b>
      			</td>
    			</tr>
    		
    			<?php $_from = $this->_tpl_vars['estado']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['orders']):
?>
    				<tr>       			
	     				<td>
	     					<?php echo ((is_array($_tmp=$this->_tpl_vars['orders']['date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%B %e, %Y") : smarty_modifier_date_format($_tmp, "%B %e, %Y")); ?>

	     				</td>
	     			
        				<td>
        					<?php if ($this->_tpl_vars['orders']['status'] == 0): ?>
        						<div class="pedidoPendiente">
        							<?php echo $this->_tpl_vars['orders']['name']; ?>

									
												
									<?php echo '
										<script language="JavaScript">
                            		var countDownInterval=20;    
                            		var c_reloadwidth=200
                            	</script> 	
                            	
                            	<ilayer id="c_reload" width=&{c_reloadwidth}; >
	                            	<layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer>
                            	</ilayer>
                            	
                            	<script>
                            		var countDownTime = countDownInterval+1;
                            		
                            		function countDown(){
                            			countDownTime--;
                            			
                            			if(countDownTime <= 0){
                            				countDownTime = countDownInterval;
                            				clearTimeout(counter);
                            				window.location.reload();
                            			}
                            			
                            			if(document.all){
                            				document.all.countDownText.innerText = countDownTime+" ";
                            			} else if (document.getElementById){
                            				document.getElementById("countDownText").innerHTML=countDownTime+" ";
                            			} else if (document.layers){
                            				document.c_reload.document.c_reload2.document.write(\''; ?>
<br />Refresco en: <?php echo '<b id="countDownText">\'+countDownTime+\'</b> '; ?>
seg<?php echo '.\');
                            				document.c_reload.document.c_reload2.document.close();
                            			}
                            			
                            			counter = setTimeout("countDown()", 1000);
                            		}
                            		
                            		function startit(){
                            			if(document.all||document.getElementById)
                            				document.write(\''; ?>
<br /> Refresco en: <?php echo '<b id="countDownText">\'+countDownTime+\'</b>'; ?>
seg<?php echo '.\');
                            			countDown();
                            		}
                            		
                            		
                            		if (document.all||document.getElementById){
                            			startit();
                            		} else{
                            			window.onload=startit
                            		}
                            	</script>
                            '; ?>

                        		
        						</div>
        					<?php else: ?>
<?php echo $this->_tpl_vars['orders']['name']; ?>


        					<?php endif; ?>
        				</td>
        			
        				<td>
          				<a href="sites.php?site=<?php echo $this->_tpl_vars['orders']['rid']; ?>
&amp;funcion=clonarPedido&amp;oid=<?php echo $this->_tpl_vars['orders']['id']; ?>
">
        						<?php echo $this->_tpl_vars['lang']['reg_order_again_link']; ?>

        					</a>
          				
          				|
          				
          				<?php if ($this->_tpl_vars['orders']['status'] == 0): ?>
          					<a href="?act=cancelarPedido&id=<?php echo $this->_tpl_vars['orders']['id']; ?>
">
        							Cancelar
        						</a>
        						
        						|
        					<?php endif; ?>
        					
        					<a href="javascript:toggle('#<?php echo $this->_tpl_vars['orders']['id']; ?>
')">
          					<?php echo $this->_tpl_vars['lang']['reg_show_details_link']; ?>

          				</a>
        				</td>
      			</tr>
      		
      			<tr> 
        				<td colspan="5">
          				<div id="<?php echo $this->_tpl_vars['orders']['id']; ?>
" style="display:none;">
            				<?php echo $this->_tpl_vars['orders']['contents']; ?>

          				</div>
        				</td>
    				</tr>
    			<?php endforeach; endif; unset($_from); ?>
  			</table>
		<?php endif; ?>
	</div>
	
	<?php $_from = $this->_tpl_vars['estado']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['orders']):
?>
		<?php if ($this->_tpl_vars['orders']['status'] == 0): ?>
			<div id="progressbar" class="ui-progressbar ui-widget ui-widget-content ui-corner-all ui-progressbar-indeterminate" role="progressbar" aria-valuemin="0">
		        <div class="ui-progressbar-value ui-widget-header ui-corner-left" style="width: 100%;">
					<div class="ui-progressbar-overlay"></div>
				</div>
			</div>
			
			<div class="ui-progressbar-value ui-widget-header ui-corner-left" style="width: 100%;">
				<div class="ui-progressbar-overlay"></div>
			</div>
			
			<div class="ui-progressbar-overlay"></div>
			
			<br>
			
			<font size="5px">Esperando confirmacion del delivery...</font>
		


<?php else: ?>
		<?php endif; ?>
	<?php endforeach; endif; unset($_from); ?>
</div>

<?php echo '
	<script type="text/javascript">
		$(document).ready(function(){
			var mensajePendiente = \'PEDIDO PENDIENTE A SER CONFIRMADO. <br> El pedido ha sido recibido, <b>por favor espere unos instantes</b>...\';
		
			jNotify(mensajePendiente, { autoHide: true, TimeShown: 10000, HorizontalPosition: \'center\', onCompleted: function(){ } } );
			 
		}); 
	</script>
'; ?>
